package com.sky.setmeal.controller;

import com.sky.setmeal.mapper.SetmealMapper;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/setmeal")
@Api(tags = "套餐管理相关接口")
@Slf4j
public class SetmealController {

    @Autowired
    private SetmealMapper setmealMapper;

    /**
     * 对外提供查询方法
     * @param id
     * @return
     */
    @GetMapping
    public Integer contSetmealByid(@RequestParam Long id) {

        return setmealMapper.countByCategoryId(id);

    }

}
